﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Vit.Common.Providers;

namespace Vit.Common
{
    public class Unity
    {
        public Unity(IUnityContainer unityContainer)
        {
            this.UnityContainer = unityContainer;
        }

        public IUnityContainer UnityContainer { get; private set; }

        public UnityService<IBasicDataProvider> BasicDataService
        {
            get
            {
                return UnityContainer.Resolve<UnityService<IBasicDataProvider>>();
            }
        }

        public UnityService<ICacheProvider> CacheService
        {
            get
            {
                return UnityContainer.Resolve<UnityService<ICacheProvider>>();
            }
        }

        public UnityService<IHelpProvider> HelpService
        {
            get
            {
                return UnityContainer.Resolve<UnityService<IHelpProvider>>();
            }
        }

        public UnityService<ILocalizeProvider> LocalizeService
        {
            get
            {
                return UnityContainer.Resolve<UnityService<ILocalizeProvider>>();
            }
        }

        public UnityService<ILogProvider> LogService
        {
            get
            {
                return UnityContainer.Resolve<UnityService<ILogProvider>>();
            }
        }

        public UnityService<ISettingProvider> SettingService
        {
            get
            {
                return UnityContainer.Resolve<UnityService<ISettingProvider>>();
            }
        }

        public UnityService<IMembershipProvider> MembershipService
        {
            get
            {
                return UnityContainer.Resolve<UnityService<IMembershipProvider>>();
            }
        }
    }
}
